#!/bin/bash - 
#===============================================================================
#
#          FILE:  stat.sh
# 
#         USAGE:  ./stat.sh 
# 
#   DESCRIPTION:  i
# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: wgwang (), wg93.wang@gmail.com
#       COMPANY: 
#       CREATED: 2011年12月26日 23时25分27秒 CST
#      REVISION:  ---
#===============================================================================

set -o nounset                              # Treat unset variables as an error
shdir=${0%/*}
cd $shdir
shdir=$PWD

PYTHON="python2.6"

mkdir -p $shdir/data/

yesterday=`date +%Y%m%d -d "1 days ago"`

log_files="/srv/lighttpd/logs/access.log.${yesterday}_*"

tmpfile="${shdir}/data/click.${yesterday}.log"

echo $log_files

cat $log_files | grep  "\"GET /url\\?"  > $tmpfile

$PYTHON $shdir/click.py $tmpfile




